{template 'common/header'}
<div class="main">
	<form action="" method="post" class="form-horizontal form" id="setting-form">
		<div class="panel panel-default">
			<div class="panel-heading">全局设置</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">图片数量</label>
					<div class="col-sm-8">
						<input type="number" name="data[num]" class="form-control" value="{$settings['num']}" placeholder="上传的图片数量"/>
					</div>
				</div>
			
				
				
				<div class="form-group">
					<div class="col-xs-12 col-sm-9 col-md-10 col-lg-10 col-sm-offset-3 col-md-offset-2 col-lg-offset-2">
						<input name="submit" type="submit" value="提交" class="btn btn-primary" />
						<input type="hidden" name="token" value="{$_W['token']}" />
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
 
<script>
require(['jquery', 'util'], function($, util){
	$(function(){
		$('#setting-form').submit(function(){
			var result = true;
			
			
			if($('input[name="data[num]"]').val() == ''){
				result = false;
				util.message('图片数量不能为空.');
			}

			if(isNaN($('input[name="data[num]"]').val())){
				result=false;
				util.message("图片数量必须为数字！");
			}
			
			return result;
		});
	});
});
</script>
{template 'common/footer'}
